<?
/*
 * @name login_form.php
 * @creater Charles Koh
 */
	session_start();
	$g_userId = $_SESSION['userid'];
	
	if($g_userId) {
		echo "Aledy to sign-in..";
	} else {
?>
<html>
<head>
	<script type="text/javascript"> 
		
		function check_input_submit() {
			if (!document.login_form.id.value)
			{
				alert("No input your ID");    
				document.login_form.id.focus();
				return;
			}
			if (!document.login_form.passwd.value)
			{
				alert("No input your passwd");    
				document.login_form.passwd.focus();
				return;
			}
			document.login_form.submit();
		}
	</script>
</head>

<body>
	<form name="login_form" method="POST" action="login.php">
		<br/><br/><br/><br/><br/><br/>
		<table align=center>
			<tr height=1 bgcolor=#5AB2C8><td></td></tr>
			<tr><td></td></tr>
			<tr>
				<td>Registered ID : 
				<input type="text" name="id" size="10" maxlength="10"></td>
			</tr>
			<tr>
				<td>Password : 
				<input type="password" name="passwd" size="10" maxlength="10"></td>
			</tr>
			<tr height=1 bgcolor=#5AB2C8><td></td> </tr>
			<tr><td></td></tr>
			<tr>
				<td>
					<input type="button" value="sign-in" onclick="check_input_submit()"/>
					<input type="button" value="Register" onclick="javascript:top.frames[1].location='index.php?page=register_form.php'"/>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
<?
	}
?>
